package com.business.corp;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

public class CompanyList
{
    private CompanyList()
    {
        
    }
    
    private static CompanyList instance = new CompanyList();
    private static List companyList = new ArrayList();
    
    static{
       companyList = CompanyFactory.getInstance().getCompanyList();
    }
    
    public static CompanyList getInstance()
    {
        return instance;
    }
    
    public List getCompanies()
    {
        return companyList;
    }
    
    public static void main( String[] args )
    {
        List companies = CompanyList.getInstance().getCompanies();
        for( int i =0 ; i<companies.size(); i++ )
        {
            CompanyEntity company = (CompanyEntity) companies.get( i );
            int companyID = company.getCompanyid();
            String companyName = company.getCompanyName();
            System.out.println( "companyID: " + companyID + " companyName: " +companyName);
        }
    }

}
